/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.WxAccessToken;
import org.apache.ibatis.jdbc.SQL;

public class WxAccessTokenSqlProvider {

    /* @mbggenerated */
    public String insertSelective(WxAccessToken record) {
        return new SQL() {
            {
                INSERT_INTO("wx_access_token");

                if (record.getAccessToken() != null) {
                    VALUES("access_token", "#{accessToken,jdbcType=VARCHAR}");
                }

                if (record.getExpiresIn() != null) {
                    VALUES("expires_in", "#{expiresIn,jdbcType=INTEGER}");
                }

                if (record.getCreateTime() != null) {
                    VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
                }

            }
        }.toString();
    }

    /* @mbggenerated */
    public String updateByPrimaryKeySelective(WxAccessToken record) {
        return new SQL() {
            {
                UPDATE("wx_access_token");

                if (record.getAccessToken() != null) {
                    SET("access_token = #{accessToken,jdbcType=VARCHAR}");
                }

                if (record.getExpiresIn() != null) {
                    SET("expires_in = #{expiresIn,jdbcType=INTEGER}");
                }

                if (record.getCreateTime() != null) {
                    SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
                }

                WHERE("id = #{id,jdbcType=INTEGER}");

            }
        }.toString();
    }
}